import {reqCategoryList} from "@/api";

const state = {
    categoryList:[]
}
const mutations = {
    SET_CATEGORY_LIST(state,payload){
        state.categoryList = payload.categoryList
    }
}
const actions = {
    async getCategoryList({commit}){
        const result = await reqCategoryList()
        commit("SET_CATEGORY_LIST",{categoryList:result})
    }
}

export default {
    namespaced:true,
    state,
    mutations,
    actions
}